﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<body>
<#assign active='evaluateList'/>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-search">
                            <form role="form" class="form-inline clearfix" id="form" action="">

                            </form>
                            <div class="form-tool btn-group">
                            <#--<button class="btn btn-sm btn-success" form="form">
                                    <i class="icon-search"></i>搜索
                                </button>-->
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>评价用户</th>
                                    <th>评价内容</th>
                                    <th>添加时间</th>
                                    <th>状态</th>
                                    <th>回复时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list pageInfo.list as item>
                                <tr>
                                    <td>${item.username!}</td>
                                    <td>${item.content!}</td>
                                    <td>${item.addtime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                    <td><#if item.reply??>已回复<#else>未回复</#if></td>
                                    <td><#if item.replytime??>${item.replytime?string('yyyy-MM-dd HH:mm:ss')}<#else>
                                        ---</#if></td>
                                    <td>
                                        <#if !item.reply??>
                                            <a class="btn btn-xs btn-success" href="#"
                                               onclick="huifu('${item.id}')">回复</a>
                                        <#else>
                                            <a class="btn btn-xs btn-primary" href="#"
                                               onclick="tipMsg('${item.reply}')">查看回复</a>
                                        </#if>
                                    </td>
                                </tr>
                                </#list>
                                </tbody>
                            </table>
                        <#include "../include/table-page.ftl"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade bs-example-modal-sm" id="evaluate" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">回复评论</h4>
                </div>
                <form class="form-horizontal" action="/admin/evaluate/save" method="post">
                    <div class="modal-body">
                        <input value="" name="id" type="hidden" id="evaluateId">
                        <div class="form-group has-info">
                            <label class="col-xs-12 col-sm-3 control-label no-padding-right">回复内容</label>
                            <div class="col-xs-12 col-sm-5">
                                <textarea class="autosize-transition form-control" name="reply"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">确认</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</body>

<#include "../include/resource-script.ftl"/>
<script>
    function huifu(id) {
        $("#evaluateId").val(id);
        $("#evaluate").modal("show");
    }
</script>

</html>

